#ifndef VOTED_PERCEPTRON_H
#define VOTED_PERCEPTRON_H
#include "array.h"
#include "sparse.h"

class perceptron {
    Array<real> w;
    Array<real> wacc;
    int norm;
    real radius;
    void accumulate(float z);
    void normalize(float z);
public:
    perceptron();
    void set(int n, float r);
    void read(const char* file);
    void write(const char* file);
    void train(Array<svector*>& trainset, int T);
    //void train(const char* file, int T);
    void test(const Array<svector*>& testset, Array<real>& pred);
    //void test(const char* file, Array<real>& pred);
    ~perceptron();
};

#endif
